using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Configuration;
using System.Web.UI;
using System.Web.UI.WebControls;
 
public partial class JobSeekers_alphabet : System.Web.UI.Page
{
    string alphabet= "";
    string connectionString="";
    protected void Page_Load(object sender, EventArgs e)
    {
        connectionString =
                         WebConfigurationManager.ConnectionStrings[
                           "RecruitVietnam"].ConnectionString;
        alphabet = Request.QueryString.Get("Alphabet");
        if (alphabet == null || alphabet == "")
            alphabet = "";
        else
            alphabet += "%";
        if(!IsPostBack)
            ShowData();
        
    }
     
    protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        ShowData();
        GridView1.PageIndex = e.NewPageIndex;
    }
    void ShowData()
    {
        GridViewHelper gridViewHelper = 
        new GridViewHelper();
        Common cls = new Common(connectionString);
        gridViewHelper.FillDataTableToGridView(
        cls.GetDataTable("SPJobByAlphabet", 
        "@Alphabet", alphabet),
        this.GridView1, 15, 10, 
        PagerButtons.NumericFirstLast);
        if(GridView1.Rows.Count == 0 )
            Literal1.Text = "Job not found.";
    }
}
